<template>
  <div class="usual1">
    <el-card class="cardOut2">
            <div slot="header">
              <div class="headerTitleClass">本人工资</div>
            </div>
<!--      <div>-->
<!--        <el-form :inline="true" :model="formInline" class="demo-form-inline">-->
<!--          <el-form-item label="审批人">-->
<!--            <el-input v-model="formInline.user" placeholder="审批人"></el-input>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="活动区域">-->
<!--            <el-select v-model="formInline.region" placeholder="活动区域">-->
<!--              <el-option label="区域一" value="shanghai"></el-option>-->
<!--              <el-option label="区域二" value="beijing"></el-option>-->
<!--            </el-select>-->
<!--          </el-form-item>-->
<!--          <el-form-item>-->
<!--            <el-button type="primary" @click="onSubmit">查询</el-button>-->
<!--          </el-form-item>-->
<!--        </el-form>-->
<!--      </div>-->

<!--      <div>-->
<!--        <el-form :inline="true" :model="queryForm" class="demo-form-inline">-->
<!--          <el-form-item label="查询工资">-->
<!--            <el-input v-model="queryForm.username" placeholder="请输入员工名字进行搜索"></el-input>-->
<!--          </el-form-item>-->
<!--          <el-form-item>-->
<!--            <el-button type="primary" @click="queryByUsername()">查询</el-button>-->
<!--          </el-form-item>-->
<!--        </el-form>-->
<!--      </div>-->
      <div>
        <el-table
            :data="videoList"
            border
            style="width: 100%">
          <el-table-column
              prop="username"
              label="姓名"
              width="180">
          </el-table-column>
          <el-table-column
              prop="position"
              label="职位"
              width="180">
          </el-table-column>
          <el-table-column
              prop="basicsalary"
              label="基本薪资">
          </el-table-column>
          <el-table-column
              prop="jiangjin"
              label="奖金">
          </el-table-column>
          <el-table-column
              prop="baoxiao"
              label="报销">
          </el-table-column>
        </el-table>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "usual1",
  data(){
    /* 定义初始化变量 */
    return{
      user:{},
      videoList:[],
      queryForm:{
        username:''
      }
    }
  },
  /* 定义事件函数 */
  methods:{
    queryEmployee(){
      this.$axios.get('/admin/querySalaryByOne?id='+ this.user.id).then(res=>{
        this.videoList.push(res.data.data)
      })
    }
  },
  /* vue的生命周期函数
     当页面加载完毕就会执行created里面的函数
  */
  created() {
    //获取用户的信息
    let user = JSON.parse(sessionStorage.getItem('user') || '{}')
    if(user != null){
      this.user = user
    }
    this.queryEmployee()
  }
}
</script>

<!-- scoped此属性可以防止当前页面的样式不会影响其他页面样式 -->
<style scoped>
@import url("Usual1.css");
</style>